package com.yunji.framework_template.orm.persistence.mapper;

import java.util.List;

import com.yunji.framework_template.common.web.Page;
import com.yunji.framework_template.orm.persistence.model.Apps;

public interface AppsMapper {

    int deleteByPrimaryKey(String packageName);

    /**
     * 删除Icon为空的的应用
     * 
     * @return
     */
    int deleteIconIsNull();

    int insert(Apps record);

    int insertSelective(Apps record);

    Apps selectByPrimaryKey(String packageName);

    int updateByPrimaryKeySelective(Apps record);

    int updateByPrimaryKey(Apps record);

    /**
     * 将今天没有更新的App的排名降低
     * 
     * @return
     */
    int updateSeq();

    List<Apps> selectByCondition(Apps record);

    List<Apps> selectAll();

    List<Apps> selectByPage(Page<?> page);

    /**
     * 根据seq的升序做分页查询
     * 
     * @param page
     * @return
     */
    List<Apps> selectByPageOrderBySeq(Page<?> page);

    /**
     * 查询Icon为空的应用数
     * 
     * @param page
     * @return
     */
    List<Apps> selectIconIsNull(Page<?> page);

    Integer count(Apps record);

    /**
     * 统计Icon为空的应用数
     * 
     * @param record
     * @return
     */
    Integer countIconIsNull(Apps record);

    int deleteByCondition(Apps record);
    
    /**
     * 查看次数+1
     * 
     * @param record
     * @return
     */
    int addViewsByPrimaryKey(Apps record);
}
